﻿//JumbotCms_4.1 Final
using System;
using JumbotCms.Common;

namespace JumbotCms.WebFile.User
{
    public partial class _pmsend : JumbotCms.API.UserCenter
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            User_Load("", "html");
            if (q("act") != "save")
                Response.Write(GetPageHtml("user_pmsend"));
            else
            {
                if (!CheckFormUrl())
                    Response.End();
                if (Str2Str(f("txtUserId")) != "0" && f("txtUserName").Length > 0 && f("txtContent").Length > 0)
                {
                    string _Content = Jumbot.Common.Strings.HtmlEncode(f("txtContent"));
                    string _Title = Jumbot.Common.Strings.CutTitle(_Content, 20);
                    SendMessage(_Title, _Content, UserId, f("txtUserId"), f("txtUserName"));
                    Response.Write("location='" + site.Dir + "user/pmlist/';");
                }
                else
                    Response.Write("JumbotCms.Alert('提交有误', '0');");
            }
        }
    }
}
